package de.andreavicentini.teatralia.generate;

import org.magiclabs.htmlx.*;
import de.andreavicentini.teatralia.pages.contact.*;
import java.util.*;

public class Contact implements ITransfx {
  protected static String nl;
  public static synchronized Contact create(String lineSeparator)
  {
    nl = lineSeparator;
    Contact result = new Contact();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "";
  protected final String TEXT_2 = NL + NL + "<h1>";
  protected final String TEXT_3 = "</h1>" + NL + "" + NL + "<p align=center>" + NL + "<br><br>" + NL;
  protected final String TEXT_4 = NL;
  protected final String TEXT_5 = NL + NL + "<br>" + NL + "<a href=\"mailto:";
  protected final String TEXT_6 = "\">";
  protected final String TEXT_7 = "</a>";
  protected final String TEXT_8 = NL;

	public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    stringBuffer.append(TEXT_1);
      
ContactPage page = (ContactPage) argument;

    stringBuffer.append(TEXT_2);
    stringBuffer.append( page.getTitle() );
    stringBuffer.append(TEXT_3);
    stringBuffer.append(TEXT_4);
    stringBuffer.append( page.getText(ContactPage.Keys.description) );
    stringBuffer.append(TEXT_5);
    stringBuffer.append( page.getMail() );
    stringBuffer.append(TEXT_6);
    stringBuffer.append( page.getMail() );
    stringBuffer.append(TEXT_7);
    stringBuffer.append(TEXT_8);
    return stringBuffer.toString();
  }
}